(function () {
    return {
        initControl: function (oControl) {
            var v = oControl.value;
            v.datavar = 0;
            v.page = ""; //页面路径

        },
        compile: function (compileContext, doc, entity) {
            var cc = compileContext;
            var tc = cc.templateCoder;

            var dataName = cc.findDataName(doc, entity.value.datavar);

            if (dataName)
                cc.dataNames.push(dataName);

            var refid = cc.newID();

            tc.add($.join([
                "<eui-page path=\"",
                entity.value.page,
                "\" params=\"appid:appid,jobid:jobid\"",
                (dataName?",value:"+dataName+".value":""),
                " events=\"onChange:notifyChange",
                refid,
                "\"/>"
            ],""));
            tc.add("<eui-page path=\""+entity.value.page+"\" events=\"onChange:notifyChange"+refid+"\"/>");

            cc.eventCoder.add("notifyChange" + refid + ":function(value){" +
                "var me = this;" +
                
                (dataName ? "me." + dataName + ".value=value;" : "") +
                
                "me.update();"+
                "}");
        }
    }
})();